package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserAgeCount;
import com.culturalCenter.dataCenter.mapper.user.UserAgeCountMapper;
import com.culturalCenter.dataCenter.service.user.UserAgeCountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserAgeCount业务层接口实现类
 * @Date
 *****/
@Service
public class UserAgeCountServiceImpl implements UserAgeCountService {

    @Resource
    private UserAgeCountMapper userAgeCountMapper;

    @Override
    public PageInfo<UserAgeCount> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userAgeCountMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userAgeCountMapper.deleteById(id);
    }

    @Override
    public Integer update(UserAgeCount userAgeCount) {
        return userAgeCountMapper.update(userAgeCount);
    }

    @Override
    public Integer add(UserAgeCount userAgeCount) {
        return userAgeCountMapper.insert(userAgeCount);
    }

    @Override
    public UserAgeCount findById(String id) {
        return userAgeCountMapper.queryById(id);
    }

    @Override
    public List<UserAgeCount> findAll(UserAgeCount userAgeCount) {
        return (List<UserAgeCount>) userAgeCountMapper.queryAll(userAgeCount);
    }

}
